<link type="text/css" rel="stylesheet" href="static/vendors/font-awesome/css/font-awesome.min.css">
<link type="text/css" rel="stylesheet" href="static/css/themes/style1/orange-blue.css" class="default-style">
<script src="static/js/jquery-1.10.2.min.js"></script>
	<div class="page-content" style="margin-top: -15px;">
		<div class="row mbl" style="overflow: auto;height: 100%;">
			<div class="col-lg-12">
				 <div class="timeline-centered" id="audit">
				 
				 </div>
			</div>
		</div>
		<input type="hidden" id="type" value="${type}">
		<input type="hidden" id="resourceId" value="${resourceId}">
	</div>


<script>
	$(function(){
		demo1();
	});
	function demo1() {
		$.ajax({
				type : "post",
				url : "./getAuditList.do",
				data : {
					"type" : $("#type").val(),
					"resourceId": $("#resourceId").val(),
				},
				dataType : "json",
				success : function(data) {
					var html="";
					for ( var i = 0; i < data.length; i++) {
							var auditType1='';
							if(data[i].auditType=='0'){
								auditType1='注册';
							}else if(data[i].auditType=='1'){
								auditType1='注销';
							}else if(data[i].auditType=='2'){
								auditType1='上架';
							}else if(data[i].auditType=='3'){
								auditType1='下架';
							}
						var status1='';
						if(data[i].status=='0'){
								status1='提交';
							}else if(data[i].status=='1'){
								status1='不通过';
							}else if(data[i].status=='2'){
								status1='通过';
							}
						if(data[i].auditUserName=='' && data[i].submitUsreName!='' && data[i].content==''){//提交者
							html += '<article class="timeline-entry left-aligned" style="width: 50%;float: left;">';
							html += '<div class="timeline-entry-inner">';
							html += ' <time  class="timeline-time" style="right: -200px"><span>'+data[i].createTime+'</span><span>申请：'+auditType1+'</span> </time>';
							html += '<div class="timeline-icon bg-green"><i class="fa fa-hand-o-left" style="line-height: 3;"></i></div>';
							html += '<div class="timeline-label bg-green">';
							html += '<h2 class="timeline-title">'+status1+'：'+data[i].submitUsreName+'</h2>';
							html += '<p>'+data[i].content+'</p>';
							html += '</div></div>';
							html += '</article>';
						}else{
							html += ' <article class="timeline-entry" style="width: 50%;float: right;">';
							html += '<div class="timeline-entry-inner">';
							html += ' <time  class="timeline-time" style="left: -200px"><span>'+data[i].createTime+'</span><span>审核：'+auditType1+'</span> </time>';
							html += '<div class="timeline-icon bg-violet"><i class="fa fa-hand-o-right" style="line-height: 3;"></i> </div>';
							html += '<div class="timeline-label bg-violet">';
							html += '<h2 class="timeline-title">'+status1+'：'+data[i].auditUserName+'</h2>';
							html += '<p>'+data[i].content+'</p>';
							html += '</div></div>';
							html += '</article>';
						}
						
					}
					$("#audit").html(html);
				},
				error : function(data) {
					alert("请求失败");
				}
			});
	};

	
</script>